a5storage_getitem_as_file Function

Syntax

L a5Storage_getItem_as_file(C connectionString ,C itemName ,C fileName [,* pResult ])

Arguments

connectionStringCharacter

Storage connection string with ::storage:: as a prefix.

itemNameCharacter

The item to retrieve from storage.

fileNameCharacter

The name and path of the local file to create.

pResultPointer

An optional dot variable that you can pass in that will be populated with information about the object.

Returns

successLogical

Returns .t. if successful. Otherwise, returns .f..

Description

Retrieves data from an item in storage, including files stored in Amazon S3 or Azure, and creates a local file

The a5Storage_getItem_as_file function retrieves an item from storage and creates a local file. For example, assume you wanted to retrieve 'Image1.jpg' which has been uploaded to S3 with the Authenticated read property turned on, you could perform an Ajax callback that executed the example below to retrieve the file and save it locally as a file called "c:\myfiles\Image1.jpg".

Example

dim cs as c

cs = "::storage::YourStorageConnectionStringName"

a5storage_getitem_as_file(cs,"Image1.jpg","c:\myfiles\Image1.jpg")

To send the file to the client from an Ajax Callback, see a5Helper_generateFileDownloadJS Function. See also Context.Response.SendFile.

See Also